<%@page import="java.util.LinkedList"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="GetData.DataWS"%>
<%@page import="dktc_ws.Hocky"%>
<%@page import="dktc_ws.Namhoc"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>



<h2>Danh sách học kỳ</h2>  
<div style="width: 100%;">

</div>
<table id="rounded-corner" summary="">
    <thead>
    <tr>
            <th scope="col" class="rounded-company">  </th>
            <th scope="col" class="rounded">Học kỳ</th>
            <th scope="col" class="rounded">Năm học</th>
            <th scope="col" class="rounded">Thời gian bắt đầu đăng ký</th>
            <th scope="col" class="rounded">Thời gian kết thúc đăng ký </th>
             <th scope="col" class="rounded">Edit</th>
              <th scope="col" class="rounded-q4">Delete </th>
        </tr>
    </thead>       
    <tbody> 
        
    
        <%
DataWS a=new DataWS();
List<Hocky> hk =new LinkedList<Hocky>();
hk = a.laydanhsachhocky(-1);

for(int i=0;i<hk.size();i++)
       {
            Hocky item=hk.get(i);
    //out.print(temp.getHoten());
%>

        <tr>
            <td></td>
            <td><%=item.getTenhk()%></td> 
            <% String tennamhoc = "";
                List<Namhoc> nh = a.laydanhsachnamhoc(item.getManamhoc());
                Namhoc namhoc = nh.get(0);
                tennamhoc = String.valueOf(namhoc.getNam1()) + " - " + String.valueOf(namhoc.getNam2());
            %>    
                        
            <td><%=tennamhoc%></td> 
            <td><%=item.getThoigianbatdaudk() %></td> 
            <td><%=item.getThoigianketthucdk()%></td>
            <td><a href="?page=edit_semester&id=<%=item.getMahk()%>"><img src="images/user_edit.png" alt="" title="" border="0" /></a></td> 
            <td><a href="?page=delete_semester&id=<%=item.getMahk()%>" class="ask"><img src="images/trash.png" alt="" title="" border="0" /></a></td> 
        </tr>      
    	      
        <%}%>         
    </tbody>
</table>
<a href="?page=add_semester" class="bt_green"><span class="bt_green_lft"></span><strong>Thêm học kỳ</strong><span class="bt_green_r"></span></a> 
     <!--a href="#" class="bt_blue"><span class="bt_blue_lft"></span><strong>View all items from category</strong><span class="bt_blue_r"></span></a--> 
